import ajax from "./axios";
const api = {
  banner: id => {
    return ajax.post("/api/banner/index", id);
  },
  download: type => {
    return ajax.post("/api/download/index", type);
  },
  service: {
    list: param => {
      return ajax.post("/api/service/list", param);
    },
    info: id => {
      return ajax.post("solve/detail", id);
    }
  }
};

export function loginApi(data) {
  return ajax({
    url: '/app/user/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getUserInfoApi(data) {
  return ajax({
    url: '/app/user/getInfo',
    headers: {
      isToken: true
    },
    method: 'post',
    data: data
  })
}
export function registerApi(data) {
  return ajax({
    url: '/app/user/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getRichTextApi(data) {
  return ajax({
    url: '/app/richText/query',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getBannerApi(data) {
  return ajax({
    url: '/app/journal-home/banner',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function queryPositionCodeList(data) {
  return ajax({
    url: '/pc/webRichTextList/queryPositionCodeList',
    headers: {
      isToken: true
    },
    method: 'get',
    data: data
  })
}

export function getMeetingApi(data) {
  return ajax({
    url: '/app/meeting/page',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getPbulisApi(data) {
  return ajax({
    url: '/app/press/v1.0/page',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}


export function submitRegisterApi(data) {
  return ajax({
    url: '/pc/press/increase',
    headers: {
      isToken: true
    },
    method: 'post',
    data: data
  })
}
export function sendEmailCodeRegApi(data) {
  return ajax({
    url: '/app/user/sendEmailCodeReg',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getProvincePageApi(data) {
  return ajax({
    url: '/common/data/page',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
export function getMailCodeApi(data) {
  return ajax({
    url: '/ierp/kapi/v2/twgf/twgf_mga/loginApi/emailVerify',
    headers: {
      isToken: true
    },
    method: 'post',
    data: data
  })
}

export function getResourceApi(data) {
  return ajax({
    url: '/ierp/kapi/v2/twgf/twgf_mga/twgf_dlr_resource_report/queryRes',
    headers: {
      isToken: true
    },
    method: 'get',
    data: data
  })
}
export function createResourceApi(data) {
  return ajax({
    url: '/ierp/kapi/v2/twgf/twgf_mga/dlrController/insertResource',
    headers: {
      isToken: true
    },
    method: 'post',
    data: data
  })
}
export function loadQRImgApi(data) {
  return ajax({
    url: '/ierp/kapi/v2/twgf/twgf_mga/twgf_dlr_baseinfo/queryBaseinfo',
    headers: {
      isToken: true
    },
    method: 'get',
    data: data
  })
}
export default api
